function fig2_14

clf
% get(gcf)
%set(gcf,'Position', [25 1115 658 230])
set(gcf,'Position', [25 885 658 516])
co = [0 0 1;
    0 0.5 0;
    1 0 0;
    0 0.75 0.75;
    0.75 0 0.75;
    0.75 0.75 0;
    0.25 0.25 0.25];
set(groot,'defaultAxesColorOrder',co)
subaxis(3,1,1,1,'MT',0.01,'MB',0.2,'MR',0.01,'ML',0.065,'P',0.02)

x=10;
nt=100*x;
t=linspace(0,4,nt);
for it=1:nt
    g(it)=t(it)^3-6*t(it)^2+9*t(it)+1;
    y1(it)=f(t(it),x);
end

hold on
plot(t,g,'b','LineWidth',1)
box on
grid on
xticks([0 1 2 3 4])
set(gca,'FontSize',12)
%xlabel('$t$-axis','Interpreter','latex','FontSize',14)
ylabel('$g(t)$','Interpreter','latex','FontSize',14)

subaxis(3,1,1,2)
plot(t,y1,'b','LineWidth',0.7)
box on
grid on
hold on
xticks([0 1 2 3 4])

ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

%xlabel('$t$-axis','Interpreter','latex','FontSize',14)
ylabel('$F(t)$','Interpreter','latex','FontSize',14)
plot([0 4],[0 0],'k','LineWidth',0.7)

set(gca,'ytick',[-1 0 1])
set(gca,'yTickLabel',{'$-1$';'0';'1'})

say=['x = 10'];
text(0.1,1.25,say,'FontSize',12,'FontWeight','bold')

x=50;
nt=100*x;
t=linspace(0,4,nt);
for it=1:nt
    y2(it)=f(t(it),x);
end

subaxis(3,1,1,3)
plot(t,y2,'b','LineWidth',0.7)
hold on
box on
grid on
xticks([0 1 2 3 4])

set(gca,'ytick',[-1 0 1])
set(gca,'yTickLabel',{'$-1$';'0';'1'})

ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

xlabel('$t$\,-\,axis','Interpreter','latex','FontSize',14)
ylabel('$F(t)$','Interpreter','latex','FontSize',14)
plot([0 4],[0 0],'k','LineWidth',0.7)

say=['x = 50'];
text(0.1,1.25,say,'FontSize',12,'FontWeight','bold')

%exportgraphics(gcf,'/Users/mark/Desktop/phase.pdf')

%  define f(t,y)
function z=f(t,x)
p=t^3-6*t^2+9*t+1;
z=cos(p*x);





